/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import javax.swing.JTable;
import javax.swing.table.TableRowSorter;

/**
 *
 * @author phat10130059
 */
public class TableUtil {

    public static void sortTable(ModelTable dmodel, JTable table, TableRowSorter<ModelTable> sorter) {
        sorter = new TableRowSorter<ModelTable>(dmodel);
        table.setRowSorter(sorter);

    }

    public static void clearTable(ModelTable dmodel) {
        while (dmodel.getRowCount() != 0) {
            //  System.out.println(dmodel1.getRowCount());
            dmodel.removeRow(dmodel.getRowCount() - 1);
            
           

        }
    }
}
